//
//  Product.m
//  LvXi_newVersion
//
//  Created by 王敏 on 16/8/29.
//  Copyright © 2016年 SJT. All rights reserved.
//

#import "Product.h"
#import "SpecModel.h"
@implementation Product

-(void)setBig_pic_wap:(NSString *)big_pic_wap{
    if(![[big_pic_wap uppercaseString] containsString:@"HTTP"]){
        big_pic_wap = [big_pic_wap addHeader:[NSString stringWithFormat:@"%@/",host]];
    }
    _big_pic_wap = big_pic_wap;
}

-(void)setSmall_pic_wap:(NSString *)small_pic_wap{
    if(![[small_pic_wap uppercaseString] containsString:@"HTTP"]){
        small_pic_wap = [small_pic_wap addHeader:[NSString stringWithFormat:@"%@/",host]];
    }
    _small_pic_wap = small_pic_wap;
}

-(void)setThumbnail_pic_wap:(NSString *)thumbnail_pic_wap{
    if(![[thumbnail_pic_wap uppercaseString] containsString:@"HTTP"]){
        thumbnail_pic_wap = [thumbnail_pic_wap addHeader:[NSString stringWithFormat:@"%@/",host]];
    }
    _thumbnail_pic_wap = thumbnail_pic_wap;
}

-(void)setSmall_pic:(NSString *)small_pic{
    if(![[small_pic uppercaseString] containsString:@"HTTP"]){
        small_pic = [small_pic addHeader:[NSString stringWithFormat:@"%@/",host]];
    }
    _small_pic = small_pic;
}

-(void)setCart_goods_num:(NSNumber *)cart_goods_num{
    _cart_goods_num = cart_goods_num;
    self.numberInShopCart = [_cart_goods_num integerValue];
}

-(void)setIntro_img:(NSArray *)intro_img{
    if(![[intro_img.firstObject uppercaseString] containsString:@"HTTP"]){
        NSMutableArray * marr = [NSMutableArray array];
        for (int i =0; i<intro_img.count; i++) {
            NSString * str = intro_img[i];
            str = [str addHeader:[NSString stringWithFormat:@"%@/",host]];
            [marr addObject:str];
        }
        _intro_img = marr;
    }else{
        _intro_img = intro_img;
    }
}

-(void)setThumbnail_pic:(NSString *)thumbnail_pic{
    if(![[thumbnail_pic uppercaseString] containsString:@"HTTP"]){
        thumbnail_pic = [NSString stringWithFormat:@"%@/%@",host,thumbnail_pic];
    }
    _thumbnail_pic = thumbnail_pic;
}

-(void)setValue:(id)value forUndefinedKey:(NSString *)key{
    
}
@end
